home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 001-025 / disk_006 / compress / zdiff < prev    next >
Text File  |  1992-05-06  |  724b  |  41 lines

  1.  
  2. OPTIONS=
  3. FILES=
  4. for ARG
  5. do
  6.     case "$ARG" in
  7.     -*)    OPTIONS="$OPTIONS $ARG";;
  8.     *)    FILES="$FILES $ARG";;
  9.     esac
  10. done
  11. if test -z "$FILES"; then
  12.     echo "Usage: zdiff [diff_options] file [file]"
  13.     exit 1
  14. fi
  15. set $FILES
  16. if test $# -eq 1; then
  17.     FILE=`expr $1 : '\(.*\)\.Z' '|' $1`
  18.     zcat $FILE | diff $OPTIONS - $FILE
  19.     STAT="$?"
  20. elif test $# -eq 2; then
  21.     case "$1" in
  22.     *.Z)    case "$2" in
  23.         *.Z)    F=`basename $2 .Z`
  24.             zcat $2 > /tmp/$F.$$
  25.             zcat $1 | diff $OPTIONS - /tmp/$F.$$
  26.             STAT="$?";;
  27.         *)    zcat $1 | diff $OPTIONS - $2;;
  28.         esac;;
  29.     *)    case "$2" in
  30.         *.Z)    zcat $2 | diff $OPTIONS $1 -
  31.             STAT="$?";;
  32.         *)    diff $OPTIONS $1 $2
  33.             STAT="$?";;
  34.         esac;;
  35.     esac
  36.     exit "$STAT"
  37. else
  38.     echo "Usage: zdiff [diff_options] file [file]"
  39.     exit 1
  40. fi
  41.